<{include file="www/header.tpl"}>
<script>
function bank_layer_close()
{
    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    window.parent.location.reload();
    parent.layer.close(index); //再执行关闭

}

function bank_submit ()
{

    if (!$("input:radio[name='accountType']").is(':checked')) {
        layer.msg('请选择你的收款账户');
        return false;
    }

    var oAccountName = $("input[name='accountName']").val();
    if (!$.trim(oAccountName)) {
        layer.msg('请输入账户名称');
        return false;
    }

    var oAccountUserName = $("input[name='accountUserName']").val();
    if (!$.trim(oAccountUserName)) {
        layer.msg('请输入您的账户');
        return false;
    }

    var data = $("#post_form").serialize();
    $.post('/bank/create',
//            {
//        accountType : $('input[name=accountType]').val(),
//        accountName : $('input[name=accountName]').val(),
//        accountUserName : $('input[name=accountUserName]').val(),
//    }
            data
            , function (o) {
        if (o.status == 0)
        {
            parent.bank_reload_banklist();
            bank_layer_close();
        }
    }, 'json');

    return false;
}
</script>

<form class="layer-form" id="post_form" action="/bank/create" method="POST" name="create" onSubmit="return bank_submit()">

    <p class="info" style="color: #e71f19;">声明：您的收款信息只用于哇吖平台之内，对外我们绝不泄露</p>
    <p class="info">提示：若选择支付宝作为收款账户，汇率按照人民币结算。</p>

    <h2 class="title">选择你的收款账户</h2>

    <div class="pay-fs fix">
            <label>
                <input type="radio" name="accountType" value="ALIPAY" class="radio">
                <img src="/resource/www/imgs/alipay_icon.png" class="img">
            </label>
            <label>
                <input type="radio" name="accountType" value="PAYPAL" class="radio">
                <img src="/resource/www/imgs/paypal_icon.png" class="img">
            </label>
    </div>

	<p class="payinfo">
        <span class="span">账户名称</span>
        <input type="text" name="accountName" placeholder="例如：张三" class="input">
    </p>
	<p class="payinfo">
        <span class="span">您的账户</span>
        <input type="text" name="accountUserName" placeholder="例如：xxxx@xxx.com" class="input">
    </p>

    <p class="bottom fix">
        <span onclick="bank_layer_close()" class="cancel">取消</span>
        <input type="submit" name="submit1" value="确定" class="ok">
    </p>
</form>
